package com.icode.web.controller;

import com.icode.core.dto.UserDTO;
import com.icode.web.startup.security.SecurityUtil;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * Created by ZhongGang
 * at 2015/1/24
 */
@Controller
@RequestMapping("/user")
public class UserController {

    @RequestMapping("/info")
    public String getUserInformation(Model model) {
        UserDTO userDTO = SecurityUtil.currentUser();
        model.addAttribute("user", userDTO);
        return "userInfo";
    }

}
